<?php

/**
 * SystemUser form base class.
 *
 * @method SystemUser getObject() Returns the current form's model object
 *
 * @package    iEasy
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseSystemUserForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'system_user_id'  => new sfWidgetFormInputHidden(),
      'name'            => new sfWidgetFormInputText(),
      'password'        => new sfWidgetFormInputText(),
      'nickname'        => new sfWidgetFormInputText(),
      'real_name'       => new sfWidgetFormInputText(),
      'email'           => new sfWidgetFormInputText(),
      'telephone'       => new sfWidgetFormInputText(),
      'cellphone'       => new sfWidgetFormInputText(),
      'qq'              => new sfWidgetFormInputText(),
      'msn'             => new sfWidgetFormInputText(),
      'description'     => new sfWidgetFormTextarea(),
      'is_online_b'     => new sfWidgetFormInputText(),
      'is_activate_b'   => new sfWidgetFormInputText(),
      'catalog_list'    => new sfWidgetFormTextarea(),
      'login_ip'        => new sfWidgetFormInputText(),
      'last_login_time' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'system_user_id'  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('system_user_id')), 'empty_value' => $this->getObject()->get('system_user_id'), 'required' => false)),
      'name'            => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'password'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'nickname'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'real_name'       => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'email'           => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'telephone'       => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'cellphone'       => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'qq'              => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'msn'             => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'description'     => new sfValidatorString(array('required' => false)),
      'is_online_b'     => new sfValidatorInteger(array('required' => false)),
      'is_activate_b'   => new sfValidatorInteger(array('required' => false)),
      'catalog_list'    => new sfValidatorString(array('required' => false)),
      'login_ip'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'last_login_time' => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('system_user[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'SystemUser';
  }

}
